package com.example.springmvc_demo.Controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;


@Slf4j
@Controller
@RequestMapping("/api")
public class HelloController {
    @RequestMapping("/hello")
    public String hello() {
        log.info("hello");
        return "";
    }
    @RequestMapping("/hello2")
    public String hello2() {
        log.info("hello2");
        return "/index3.html";
    }
    @RequestMapping(value = "/hello2",method = RequestMethod.POST)
                public String hello3() {
                    log.info("hello3");
                    return "forward:index3.html";
                }
    @RequestMapping(value = "/hello2",params = "name")
    public String hello4() {
        log.info("hello4");
        return "/index3.html";
    }


    }





